package com.itheima.request.a_line;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/lineServlet")
public class LineServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //获取虚拟目录
        String contextPath = request.getContextPath();
        System.out.println("contextPath = " + contextPath);
        //获取请求路径
        String requestURI = request.getRequestURI();
        System.out.println("requestURI = " + requestURI);

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }
}
